Ttbiji::Application.routes.draw do

  get "admin/codeparter" => 'codeparter#index'
  post "admin/codeparter" => 'codeparter#save'
  post "admin/codeparter/delete" => 'codeparter#delete'
  get "admin/feedback"
  get "admin/feedback/p:page" => 'admin#feedback'
  post "admin/feedback/reply" => 'admin#feedback_reply'
  post "/admin/feedback/delete" => 'admin#feedback_delete'
  post "/admin/feedback/deletes" => 'admin#feedback_deletes'
  get "admin/sms"
  post "admin/sms_send"
  get "admin/doc" => 'doc#check'
  post "admin/doc/check_passindex" => 'doc#check_passindex'
  get "admin/doclist" => 'doc#admin_doclist'
  get "admin/userlist" => 'user#admin_userlist'
  get "admin/memolist" => 'memo#admin_memolist'
  post "admin/memo/delete" => "memo#admin_memodelete"

  get "memo" => 'memo#index'
  get "memo/p:page" => 'memo#index'
  post "memo/create" => 'memo#create'
  post "memo/delete" => 'memo#delete'
  post "memo/update" => 'memo#update'

  get "sitemap.xml" => "suggestion#sitemap"
  get "feedback" => "suggestion#index"
  get "feedback/p:page" => "suggestion#index"
  post "feedback/create" => "suggestion#create"
  get "plan" => "suggestion#plan"
  get "about" => "suggestion#about"
  get "faq" => "suggestion#faq"
  get "privacy" => "suggestion#privacy"
  get "rili" => "suggestion#rili"

  get 'doc/cate' => 'doc#cate_conf'
  post 'doc/cate_delete' => 'doc#cate_delete'
  post 'doc/cate_save' => 'doc#cate_save'
  post 'doc/cate_new' => 'doc#cate_new'
  get 'doc/share/(:randcode)_:docid.html' => 'doc#share2'
  get "doc/share/:userid/:docid.html" => "doc#share" # 分享
  post "doc_mains" => "doc#create" # 发布
  put "doc_mains/:docid" => "doc#update" # 修改
  get "doc" => 'doc#index'
  get "doc/p:page" => 'doc#index'
  get "doc/list/:cateid" => 'doc#index'
  get "doc/list/:cateid/p:page" => 'doc#index'
  get "doc/show/(:docid)a.html" => 'doc#showa' # A类型最终页
  get "doc/getdetailurl/:docid" => 'doc#detailUrl' # 获取最终页url
  get "doc/show/:docid" => 'doc#show'
  post "doc/delete" => 'doc#delete'
  get "doc/new" => 'doc#new'
  get "doc/edit/:docid" => 'doc#new'
  post "doc/save" => "doc#saveDoc"
  resources :doc_mains

  resources :blogs
  
  #post "users"
  post "users" => "user#create"
  post "user/login"
  get 'user/login'
  get 'user/reg'
  get 'user/logout'
  get 'user/profile'
  put 'user/profile' => 'user#profile_post'
  get 'user/validemail'
  get '/user/forgetpass'
  get '/user/resetpass'
  post '/user/resetpass_post'
  post '/user/check_pass_answer'
  post '/user/resetpass_email'

  get "test2/login"
  get "test/login"

  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  root :to => 'user#index'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id))(.:format)'
end
